package com.by.service.impl;

import com.by.bean.QueryReturnsRefunds;
import com.by.bean.ReturnsRefunds;
import com.by.common.core.bean.PageBean;
import com.by.common.core.crud.BaseServiceImpl;
import com.by.mapper.ReturnsRefundsMapper;
import com.by.service.ReturnsRefundsService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReturnsRefundsServiceImpl extends BaseServiceImpl<ReturnsRefunds, ReturnsRefundsMapper> implements ReturnsRefundsService {


    @Autowired
    ReturnsRefundsMapper returnsRefundsMapper;


    @Override
    public PageBean queryRefunds(QueryReturnsRefunds refunds) {
        PageHelper.startPage(refunds.getPage(),refunds.getPageSize());
        List list = returnsRefundsMapper.queryRefunds(refunds);
        PageInfo info=new PageInfo(list);
        return new PageBean(info.getSize(),info.getPageSize(),info.getTotal(),list) ;
    }
}
